<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>产测</title>
</head>
<style>
    /* Basic Grey */

    .basic-grey {

        margin-left:auto;

        margin-right:auto;

        max-width:100%;

        background: #F7F7F7;

        padding: 25px 15px 25px 10px;

        font: 12px Georgia, "Times New Roman", Times, serif;

        color: #888;

        text-shadow: 1px 1px 1px #FFF;

        border:1px solid #E4E4E4;

    }

    .basic-grey h1 {

        font-size: 25px;

        padding: 0px 0px 10px 40px;

        display: block;

        border-bottom:1px solid #E4E4E4;

        margin: -10px -15px 30px -10px;;

        color: #888;

    }

    .basic-grey h1>span {

        display: block;

        font-size: 11px;

    }

    .basic-grey label {

        display: block;

        margin: 0px;

    }

    .basic-grey label>span {

        float: left;

        width: 20%;

        text-align: right;

        padding-right: 10px;

        margin-top: 10px;

        color: #888;

    }

    .basic-grey input[type="text"], .basic-grey input[type="email"], .basic-grey textarea, .basic-grey select {

        border: 1px solid #DADADA;

        color: #888;

        height: 30px;

        margin-bottom: 16px;

        margin-right: 6px;

        margin-top: 2px;

        outline: 0 none;

        padding: 3px 3px 3px 5px;

        width: 70%;

        font-size: 12px;

        line-height:15px;

        box-shadow: inset 0px 1px 4px #ECECEC;

        -moz-box-shadow: inset 0px 1px 4px #ECECEC;

        -webkit-box-shadow: inset 0px 1px 4px #ECECEC;

    }

    .basic-grey textarea{

        padding: 5px 3px 3px 5px;

    }

    .basic-grey select {

        background: #FFF no-repeat right;

        background: #FFF no-repeat right;

        appearance:none;

        -webkit-appearance:none;

        -moz-appearance: none;

        text-indent: 0.01px;

        text-overflow: '';

        width: 70%;

        height: 35px;

        line-height: 25px;

    }

    .basic-grey textarea{

        height:100px;

    }

    .basic-grey .button {

        background: #E27575;

        border: none;

        padding: 10px 25px 10px 25px;

        color: #FFF;

        box-shadow: 1px 1px 5px #B6B6B6;

        border-radius: 3px;

        text-shadow: 1px 1px 1px #9E3F3F;

        cursor: pointer;

    }

    .basic-grey .button:hover {

        background: #CF7A7A

    }
    /* 悬停添加箭头图标 */
    .niceButton5 {
        display: inline-block;
        border-radius: 20px;
        background-color: #f4511e;
        border: none;
        color: #ffff;
        text-align: center;
        font-size: 20px;
        font-weight: 300;
        padding: 18px;
        width: 150px;
        transition: all 0.5s;
        cursor: pointer;
        margin: 5px;
        vertical-align: middle;
    }
    .niceButton5 span {
        cursor: pointer;
        display: inline-block;
        position: relative;
        transition: 0.5s;
    }
    .niceButton5 span::after {
        content: ">";
        position: absolute;
        opacity: 0;
        top: 0;
        right: -20px;
        transition: 0.5s;
    }
    .niceButton5:hover span {
        padding-right: 30px;
    }
    .niceButton5:hover span::after {
        opacity: 1;
        right: 0;
    }

</style>
<body>
<center>
</center>
<div style="background: #f7f7f7;width: 100%">
<center>
    <button onclick="scanQRCode()" class="niceButton5">点击扫描</button>
</center>
</div>
<form action="" method="post" class="basic-grey">

    <label>

        <span>设备编号 :</span>

        <input id="deviceNum" value="待扫描" disabled="true" type="text"/>

    </label>
    <label>

        <span>Themplate :</span>

        <select id="template" name="themplate">

            <option value="basic-grey">basic-grey</option>


        </select>

    </label>

    <label>

        <span>Your Name :</span>

        <input id="name" type="text" name="name" placeholder="Your Full Name" />

    </label>

    <label>

        <span>Your Email :</span>

        <input id="email" type="email" name="email" placeholder="Valid Email Address" />

    </label>



    <label>

        <span>Message :</span>

        <textarea id="message" name="message" placeholder="Your Message to Us"></textarea>

    </label>

    <label>

        <span>Subject :</span><select name="selection">

        <option value="Job Inquiry">Job Inquiry</option>

        <option value="General Question">General Question</option>

    </select>

    </label>

    <label>

        <span>&nbsp;</span>

        <input type="button" class="button" value="Send" />

    </label>

</form>
<div id="result"></div>
<script src="https://ylc.yimitongxun.com/public/static/js/jquery-v3.6.4.min.js"></script>
<script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
    $(function(){
        $.ajax({
            type: "GET",
            url: "/api/pro_set?" + encodeURI(location.href),
            dataType: "json",
            data: {},
            success: function (res) {
                wx.config({
                    debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
                    appId: res.data.appId, // 必填，公众号的唯一标识
                    timestamp: res.data.timestamp, // 必填，生成签名的时间戳
                    nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
                    signature: res.data.signature,// 必填，签名
                    jsApiList: res.data.jsApiList// 必填，需要使用的JS接口列表
                });
            },
        })
    });

    // 扫描二维码
    function scanQRCode() {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode'],
            success: function (res) {
                var result = res.resultStr;
                alert(result);
                // const queryString = result.split('?')[1];
                // const urlParams = new URLSearchParams(queryString);
                // var param = urlParams.get('id');
                // const sn = param.split('-')[0];

                document.getElementById('result').innerText = '扫描结果：' + result;

            },
            fail: function (res) {

            }
        });
    }
</script>
</body>
</html>
